<%--
  Created by IntelliJ IDEA.
  User: Chinonuo
  Date: 2019/4/12
  Time: 16:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<form enctype="multipart/form-data" method="post" action="${pageContext.request.contextPath}/test1?method=run2">

    用户名: <input type="text" name="userName"> <br>
    密码<input type="password" name="password"> <br>
    添加文件: <input type="file" name="uploadFile" id="file" onchange="run1(this)"/>

    <input type="submit" value="上传">
</form>

<script>
    function run1(ele) {
        var file = ele.files;
        console.log(file[0].size);
    }


</script>

</body>
</html>
